function getStage()
	if _G.StageType == 2 then
		return "EX";
	elseif _G.StageType == 3 then
		return "OMES";
	else
		return _G.StageIndex;
	end;
end;

local clr = color("0,0,0,.8");
local t = Def.ActorFrame{
	--[[Def.Quad{
		InitCommand=cmd(diffuse,Color("Black");setsize,SCREEN_WIDTH*1.5,5;rotationz,-5;xy,SCREEN_CENTER_X,30);
	};
    Def.ActorMultiVertex{
        InitCommand=function(self)
            self:xy(-1, -1)--:valign(1):halign(1);
            self:SetDrawState{Mode="DrawMode_Triangles"}
            self:SetVertices({
				{{0, 0, 0}, clr},
				{{0, 50, 0}, clr},
				{{400, 0, 0}, clr}
				
			});
        end;
        
    };
    Def.Quad{
    	InitCommand=cmd(xy,400/2,50/2;setsize,400,2;rotationz,math.asin(50/400)*(180/math.pi)*-1;fadebottom,1);
    };
	
	LoadFont("Dialogue Stage Titles")..{
		Text="Stage "..getStage();		
		--To get the angle, inverse sin(y/x) then convert to radians with (180/math.pi) then make it negative (because this triangle is upside down)
		InitCommand=cmd(xy,90,35;rotationz,-13;vertalign,bottom;shadowcolor,Color("Black");diffusebottomedge,Color("Purple");shadowlength,1;);
		OnCommand=cmd(rotationz,math.asin(50/400)*(180/math.pi)*-1+1);
	};]]
	
};
for pn in ivalues(GAMESTATE:GetHumanPlayers()) do
	t[#t+1] = LoadFont("System")..{
		Text=THEME:GetString("Common","PressStart");
		InitCommand=cmd(zoom,1.5;vertalign,top;y,5;shadowcolor,color("#061CE8");shadowlengthy,3);
		OnCommand=function(self)
			--Positioned for the opposite player
			if pn ~= PLAYER_1 then
				self:x(SCREEN_CENTER_X/2);
			else
				self:x(SCREEN_WIDTH*.75);
			end;
		end;
	};
	t[#t+1] = LoadFont("System")..{
		Text="STAGE "..getStage();
		InitCommand=cmd(zoom,1.5;vertalign,top;y,5;shadowcolor,color("#061CE8");shadowlengthy,3);
		OnCommand=function(self)
			if pn == PLAYER_1 then
				self:x(SCREEN_CENTER_X/2);
			else
				self:x(SCREEN_WIDTH*.75);
			end;
		end;
	};
end

return t;
